package com.dominos.voldemortstress;

import org.junit.Test;

import voldemort.client.ClientConfig;
import voldemort.versioning.Versioned;

public class WriteThreadTestNonMocked {

	@Test
	public void testRun() {
		String bootstrapUrl = "tcp://localhost:6666";
		ClientConfig clientConfig = new ClientConfig();
		clientConfig.setBootstrapUrls(bootstrapUrl);

		byte[] dataToWrite = { 3, 1, 2 };

		VoldemortStoreClientMaker voldemortStoreClientMaker = new VoldemortStoreClientFactory();

		VoldemortStoreClient voldemortStoreClient = voldemortStoreClientMaker
				.createStoreClient(clientConfig, "stressTestStore");

		WriteThread writeThread = new WriteThread(voldemortStoreClient, 10000,
				dataToWrite);

		new Thread(writeThread).start();
		writeThread.quit();

		byte[] key = { 12, 1, 2 };
		Versioned<Object> value = voldemortStoreClient.get(key);

	}
}
